package Communication;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author mgrutman
 */
public class ExeTelnetFromText 
{
    public String [] readCmdListFromFile (String fname)
    {
        String [] res = new String [1000];
        int i = 0;
        
        try
        {
            BufferedReader fp = null;
            fp = new BufferedReader(new FileReader(fname));
            try
            {
                while (fp.ready())
                {
                    String line = fp.readLine();
                    res [i++] = line;
                }
                fp.close();
            } 
            catch (IOException ex)
            {
                Logger.getLogger(ExeTelnetFromText.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        catch (FileNotFoundException ex)
        {
            Logger.getLogger(ExeTelnetFromText.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        String [] resa = new String [i];
        System.arraycopy(res, 0, resa, 0, i);
        
        return null;
    }
}

